package com.chanzany.interview_secondary.jvm.jvm_05_GCCollecters;

import java.util.Random;

/**
 1.
 -Xms10m -Xmx10m -XX:+PrintGCDetails -XX:+PrintCommandLineFlags -XX:+UseSerialGC    (DefNew+Tenured)

 2.
 -Xms10m -Xmx10m -XX:+PrintGCDetails -XX:+PrintCommandLineFlags -XX:+UseParNewGC    (DefNew+Tenured)
警告：Java HotSpot(TM) 64-Bit Server VM warning: Using the ParNew young collector with the Serial old collector
 is deprecated and will likely be removed in a future release

 3.
 -Xms10m -Xmx10m -XX:+PrintGCDetails -XX:+PrintCommandLineFlags -XX:+UseParallelGC    (PSYoungGen+ParOldGen)

 4.
 4.1
 -Xms10m -Xmx10m -XX:+PrintGCDetails -XX:+PrintCommandLineFlags -XX:+UseParallelOldGC    (PSYoungGen+ParOldGen)
 4.2 不加就是默认UseParallelGC
 -Xms10m -Xmx10m -XX:+PrintGCDetails -XX:+PrintCommandLineFlags   (PSYoungGen+ParOldGen)

 5.
 -Xms10m -Xmx10m -XX:+PrintGCDetails -XX:+PrintCommandLineFlags -XX:+UseConcMarkSweepGC  (ParNew+Concurrent mark-sweep)

 6.
 -Xms10m -Xmx10m -XX:+PrintGCDetails -XX:+PrintCommandLineFlags -XX:+UseG1GC  (ParNew+Concurrent mark-sweep)
 */
public class Demo {
    public static void main(String[] args) {
        try {
            String str = "chanzany";
            while (true){
                str += str+new Random().nextInt(77777777)+new Random().nextInt(888888);
                str.intern();
            }
        }catch (Throwable e){
            e.printStackTrace();
        }
    }
}
